package com.itheima.boject;

public class DemoStringBuilder {
    public static void main(String[] args) {
        //ctrl+alt+m快速抽取方法

        //获取时间节点
        long start = System.currentTimeMillis();

        StringBuilder sb = new StringBuilder();
        for (int i = 1; i <= 50000; i++) {
            sb.append(i);
        }
        System.out.println(sb);
        long end = System.currentTimeMillis();
        System.out.println(end - start);
    }


    public static void method() {
        long start = System.currentTimeMillis();
        String s = "";
        for (int i = 1; i <= 50000; i++) {
            s += i;
        }
        System.out.println(s);
        long end = System.currentTimeMillis();
        System.out.println(end - start);

    }
}